﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Elite
{
    class Player
    {
        public string Name { get; set; }

        public int Account { get; set; }

        public Planet ActualPlanet { get; set; }

        public Star ActualPosition { get; set; }

        public Ship ActualShip { get; set; }

        public State ActualState { get; set; }

        public string Serialize()
        {
            var str = "";
            
            if (this.ActualPlanet != null)
                str += "Localisation actuelle : Planète " + this.ActualPlanet.Name + "\n\r";
            else
                str += "Dans l'espace, dans le système S-" + this.ActualPosition.Name + "\n\r";

            str += "--------" + "\n\r";

            str += "Informations du joueur " + this.Name + "\n\r";
            str += "Compte en banque : " + this.Account + "\n\r";

            str+= "--------" + "\n\r";

            str+= "Informations sur le vaisseau " + this.ActualShip.Name + "\n\r";

            str += this.ActualShip.Serialize();

            return str;
        }

        public Player()
        {
            this.ActualShip = new Ship() { Name = "FireFly" };
        }
    }

    public enum State
    {
        SurUnePlanete = 0,
        DansLaZoneCommerciale = 1,
        DansLeHangar =2,
        DansLespace = 3
    }
}
